"""
练习1：使用生成器表达式在列表中获取所有字符串.
list01 = [43, "a", 5, True, 6, 7, 89, 9, "b"]
练习2：在列表中获取所有整数,并计算它的平方.

"""
list01 = [43, "a", 5, True, 6, 7, 89, 9, "b"]

generator_new = (item for item in list01 if isinstance(item,str))
for item in generator_new:
    print(item)

print('=' * 30)


generator_new2 = (item**2 for item in list01 if type(item) is int)
for item in generator_new2:
    print(item)
